package com.xiaoma.tpo.utils;

import java.util.List;

public class Pager {

    private int itemsPerPage = 20;
    private int curPage = 1;
    private List<?> list;
    private int totalCount;
    
    
    public int getItemsPerPage() {
        return itemsPerPage;
    }
    public void setItemsPerPage(int itemsPerPage) {
        this.itemsPerPage = itemsPerPage;
    }
    public int getCurPage() {
        return curPage;
    }
    public void setCurPage(int curPage) {
        this.curPage = curPage;
    }
    @SuppressWarnings("unchecked")
    public <T> List<T> getList() {
        return (List<T>) this.list;
    }
    public <T> void setList(List<T> list) {
        this.list = list;
    }
    
    public int getTotalCount() {
        return totalCount;
    }
    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }
    public int getBeginIndex(){
        return (this.curPage - 1) * this.itemsPerPage; 
    }
    
    
}
